package com.shuoyue.ycgk.ui.course.mycourse;

import android.text.TextUtils;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;
import com.shuoyue.ycgk.entity.Course;
import com.shuoyue.ycgk.utils.GlideUtil;

import java.util.List;

public class CoursePauchesAdapter extends AppBaseQuickAdapter<Course> {

    public CoursePauchesAdapter(@Nullable List<Course> data) {
        super(R.layout.item_course_pauchers, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Course item) {
        helper.addOnClickListener(R.id.lay_all);
        helper.setText(R.id.title, item.getName());
        GlideUtil.loadImage(mContext, item.getCover(), helper.getView(R.id.img));
        helper.setText(R.id.effectTime, TextUtils.isEmpty(item.getValidDate())?
                "永久":("至"+item.getValidDate()));
    }
}
